package es.esp.ut04;

public class Test2 {
	
	public static class Dog {
		String name;

		public Dog(String name) {
			
			this.name = name;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}
		
		public String toString(){
			return name;
		}
		
	}
	
	public static void foo(Dog d) {
		 System.out.println(d.toString()); 
		  d = new Dog("Fifi");
		  System.out.println(d.toString()); 
		}

	
	public static void main(String args[]) {
		
		
			Dog aDog = new Dog("Max");
			foo(aDog);
			System.out.println(aDog.toString()); 
	
	}

}
